package dbtools.structures;

import java.sql.Timestamp;
import java.util.Date;

public class DBFieldDatetime extends DBField<Date> {

	private static final long serialVersionUID = 1L;

	@Override
	public String getSqlType() {
		return "TIMESTAMP";
	}

	@Override
	public Object getValueForSQL() {
		if (getValue() == null){
			return null;
		}
		return new Timestamp(getValue().getTime());
	}

	@Override
	public void _setValueFromSQL(Object value) {
		setValue((Timestamp) value);
	}
	

}
